﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Mvc;

namespace Comet_sample.Controllers
{
    public class HomeController : Controller
    {
        public ViewResult Login()
        {
            if (Request.Cookies["sid"] == null)
            {
                var cookie = new System.Web.HttpCookie("sid", Session.SessionID);
                cookie.Expires = DateTime.Now.AddDays(1);
                Response.Cookies.Add(cookie);
            }
            else
            {
                var cookie = Request.Cookies["sid"];
                cookie.Expires = DateTime.Now.AddDays(1);
                Response.SetCookie(cookie);
            }
            return View();
        }

        public ViewResult Chat()
        {
            return View();
        }
    }
}
